lib/repo: Always look in staging directory for objects
authorAlexander Larsson <alexl@redhat.com>
Thu, 8 Jun 2017 07:43:23 +0000 (09:43 +0200)
committerAtomic Bot <atomic-devel@projectatomic.io>
Tue, 13 Jun 2017 00:47:42 +0000 (00:47 +0000)
commit7159bed8e182781ccdc9a5913457cf6fda0bcfbe
tree02be9ad09fd827a8951b617c4153158e5a0833b0
parent848b7c020121fbda8d1028bf5e0e9adf8c591b0c
lib/repo: Always look in staging directory for objects

Its often the case that we want to look at objects inside a commit,
before the objects the transaction is finished. For instance:
  https://github.com/flatpak/flatpak/pull/837
Which tries to verify the file permissions before committing the
transaction.

And:
  https://github.com/flatpak/flatpak/commit/1e5ffa926a25acb655af7889b679b140bf44870b
Which collects the storage size of the objects so that we can
put the total download size in the commit metadata.

I tried to find all the places where we did reads from the
object directories, and in particular this fixes:

 - `ostree_repo_load_file()` for `bare` repos (`archive` was already working).
 - `ostree_repo_query_object_storage_size()`
 - Applying deltas that reference not-yet-commited objects

Closes: #916
Approved by: cgwalters
src/libostree/ostree-repo.c